#!/bin/sh
# php7.4
# 官方版本默认安装扩展: 
# Core, ctype, curl, cgi-fcgi
# date, dom
# fileinfo, filter, ftp
# hash
# iconv
# json
# libxml
# mbstring, mysqlnd
# openssl
# pcre, PDO, pdo_sqlite, Phar, posix
# readline, Reflection
# session, SimpleXML, sodium, SPL, sqlite3, standard
# tokenizer
# xml, xmlreader, xmlwriter
# zlib

echo
echo "============================================"
echo "Install extensions from   : ${MORE_EXTENSION_INSTALLER}"
echo "PHP version               : ${PHP_VERSION}"
echo "Multicore Compilation     : ${MC}"
echo "Work directory            : ${PWD}"
echo "============================================"
echo

echo "---------- wddx was REMOVED from PHP 7.4.0 ----------"
echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------"
echo "---------- ereg、mhash、mysql was REMOVED from PHP 7.0.0 ----------"

echo "---------- Install gd php ----------"
apt-get update && apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install ${MC} gd

echo "---------- Install ffi libffi-dev ----------"
apt-get install -y --no-install-recommends libffi-dev \
&& docker-php-ext-install ${MC} ffi

echo "---------- Install igbinary ----------"
pecl install igbinary-3.2.7 \
&& docker-php-ext-enable igbinary

echo "---------- Install mongodb ----------"
pecl install mongodb-1.14.0 \
&& docker-php-ext-enable mongodb

echo "---------- Install pdo_sqlsrv unixodbc-dev ----------"
pecl install pdo_sqlsrv-5.10.1 \
&& docker-php-ext-enable pdo_sqlsrv

echo "---------- Install sqlsrv unixodbc-dev ----------"
pecl install sqlsrv-5.10.1 \
&& docker-php-ext-enable sqlsrv

echo "---------- Install redis ----------"
pecl install redis-5.3.7 \
&& docker-php-ext-enable redis

echo "---------- Install swoole ----------"
pecl install swoole-4.8.10 \
&& docker-php-ext-enable swoole
